# Base Images
## 从天池基础镜像构建(from的base img 根据自己的需要更换，建议使用天池open list镜像链接：https://tianchi.aliyun.com/forum/postDetail?postId=67720)
# FROM registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.6-cuda10.1-py3
FROM  registry.cn-shanghai.aliyuncs.com/tcc-public/pytorch:1.7-cuda11.0-py3
RUN pip install pandas -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install numpy -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install jieba -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install tqdm -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install ujson -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install rjieba -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install transformers==4.3.0.rc1 -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install sklearn -i https://mirrors.aliyun.com/pypi/simple/
## 指定默认工作目录为根目录（需要把run.sh和生成的结果文件都放在该文件夹下，提交后才能运行）
WORKDIR /

# ADD code /

# ADD requirements.txt /
##安装依赖包,pip包请在requirements.txt添加
# RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
# for onnx
#RUN rm -rf /etc/apt/sources.list.d/cuda.list && apt update && apt install curl -y && apt clean

## 把当前文件夹里的文件构建到镜像的根目录下
ADD . /

RUN chmod +x /run.sh

## 镜像启动后统一执行 sh run.sh
CMD ["sh", "run.sh"]
